$(function(){
	var str = window.location.search;
                var num = str.indexOf("?");
                var id = str.substr(num+1);
              $.ajax({
                        type:"POST",
                        dataType:"json",
                        url:"/ajax/info",
                        data:id,
                        headers:{ 'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content')
                      },
                      success:function(result){
                              var info = result.info;
                              var type = result.type;
                              var  levelAll="";
                              for(var i=0;i<type.length;i++){
                             	var levelname = type[i].typename;
                                var  levelAll =levelname+"   "+ levelAll;
                              }
                                username_login = info['username'];
                              	var user = "欢迎,"+info['username']+" | ";
                               document.getElementById('login').innerHTML=user;
                               document.getElementById("register").innerHTML="退出";
                               $('#register').attr('href','/login');
                               $('#login').removeAttr('href');
                               $('#login').css('color','snow');
                               $('#return_main').attr('href',"/useraccount?id="+id.split('=')[1]);
                      }
                       });
});